#include "mainwindow.h"

#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QWebEngineView>
#include <QJSEngine>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    m_web(new QWebEngineView(this))
{
    QWidget *w = new QWidget(this);
    setCentralWidget(w);
    QVBoxLayout *v = new QVBoxLayout(w);

    m_web->load(QUrl("https://hacpai.com/guide/markdown"));


    QPushButton *btn = new QPushButton(tr("test"), this);
    connect(btn, SIGNAL(clicked(bool)), SLOT(onBtnClicked()));

    QHBoxLayout *h = new QHBoxLayout();
    h->addWidget(m_web);

    h->addLayout(v);
}

MainWindow::~MainWindow()
{
}

//void MainWindow::onBtnClicked()
//{
//    m_web->page()->runJavaScript();
//}
